﻿using System.Text.RegularExpressions;
using System.Windows;

namespace 餐饮管理系统
{
    //class RegexLibrary
    //{
    //    public static Regex MobilePhoneRegex = new Regex(@"^(\d{1,3}-){0,2}\d{11}$");
    //    public static Regex HomePhoneRegex = new Regex(@"^(\d{1,3}-){0,2}\d{8}$");
    //    public static Regex EmailRegex = new Regex(@"^\w+(\.\w+)*@\w+(\.\w+)+$");
    //    public static Regex DateTimeRegex = new Regex(@"^((((1[6-9]|[2-9]\d)\d{2})[-/](0?[13578]|1[02])[-/](0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})[-/](0?[13456789]|1[012])[-/](0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})[-/]0?2[-/](0?[1-9]|1\d|2[0-8]))|(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))[-/]0?2[-/]29))(\s((20|21|22|23|[0-1]?\d):[0-5]?\d:[0-5]?\d))?$");
    //    public static Regex DateRegex = new Regex(@"^((((1[6-9]|[2-9]\d)\d{2})[-/](0?[13578]|1[02])[-/](0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})[-/](0?[13456789]|1[012])[-/](0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})[-/]0?2[-/](0?[1-9]|1\d|2[0-8]))|(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))[-/]0?2[-/]29))$");
    //    public static Regex SalaryRegex = new Regex(@"^\d+(\.\d{1,2})?$");
    //}
    public partial class MainWindow : Window
    {
        Regex MobilePhoneRegex = new Regex(@"^(\d{1,3}-*){0,2}\d{11}$");
        Regex HomePhoneRegex = new Regex(@"^(\d{1,3}-){0,2}\d{8}$");
        Regex EmailRegex = new Regex(@"^\w+(\.\w+)*@\w+(\.\w+)+$");
        Regex DateTimeRegex = new Regex(@"^((((1[6-9]|[2-9]\d)\d{2})[-/](0?[13578]|1[02])[-/](0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})[-/](0?[13456789]|1[012])[-/](0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})[-/]0?2[-/](0?[1-9]|1\d|2[0-8]))|(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))[-/]0?2[-/]29))(\s((20|21|22|23|[0-1]?\d):[0-5]?\d:[0-5]?\d))?$");
        Regex DateRegex = new Regex(@"^((((1[6-9]|[2-9]\d)\d{2})[-/](0?[13578]|1[02])[-/](0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})[-/](0?[13456789]|1[012])[-/](0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})[-/]0?2[-/](0?[1-9]|1\d|2[0-8]))|(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))[-/]0?2[-/]29))$");
        Regex SalaryRegex = new Regex(@"^\d+(\.\d{1,2})?$");

        Regex finItemRegex = new Regex(@"^\w+$");
        Regex finNumRegex = new Regex(@"^\d{1,3}$");
        Regex finPriceRegex = new Regex(@"^-{0,1}\d{1,3}(.\d+){0,1}$");

        //Regex orderItemRegex = new Regex(@"^\w+$");
        Regex orderMenuNumRegex = new Regex(@"^\d{1,3}$");
        Regex orderMenuCountRegex = new Regex(@"^\d{1,3}$");
        Regex orderTableNumRegex = new Regex(@"^\d{1,3}$");
    }
}
